package com.dormitory.management.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dormitory.management.system.req.HousemasterPageReq;
import com.dormitory.management.system.req.HousemasterSaveReq;
import com.dormitory.management.system.req.HousemasterUpdateReq;
import com.dormitory.management.system.req.HousemasterUpdateRoomReq;
import com.dormitory.management.system.resp.HousemasterResp;
import com.dormitory.management.system.entity.Housemaster;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dormitory.managemnet.util.core.Result;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * <p>
 * 宿管表 服务类
 * </p>
 *
 * @author
 * @since 2021-12-17
 */
public interface HousemasterService extends IService<Housemaster> {
    /**
     * 添加宿管基本信息
     * @param req 插入内容
     * @return
     */
    boolean save(HousemasterSaveReq req);

    /**
     * 删除宿管
     * @param id 宿管id
     * @return
     */
    boolean delete(Long id);

    /**
     * 更新宿管基本信息
     * @param req 更新内容
     * @return
     */
    boolean update(HousemasterUpdateReq req);

    /**
     * 安排宿管所属楼栋房间
     * @param req 楼栋id和房间id
     * @return
     */
    boolean saveRoom(HousemasterUpdateRoomReq req);

    /**
     * 更新宿管所属楼栋房间
     * @param req 楼栋id和房间id
     * @return
     */
    boolean updateRoom(HousemasterUpdateRoomReq req);

    /**
     * 根据查询条件分页查询
     * @param req 查询条件
     * @return 分页列表
     */
    IPage<HousemasterResp> getPage(HousemasterPageReq req);

    /**
     * 更新全部楼栋表宿管名
     * @param id
     * @return
     */
    boolean HousemasterNameUpdate(Long id);

    /**
     * 更新全部楼栋表宿管名
     * @return
     */
    boolean HousemasterNameAllUpdate();

    Result importHousemasterByExcel(String username, MultipartFile file) throws IOException;

}
